home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_vim.idb / usr / freeware / share / vim / syntax / tcl.vim.z / tcl.vim
Encoding:
Text File  |  1998-10-28  |  1.9 KB  |  59 lines

  1. " Vim syntax file
  2. " Language:    TCL
  3. " Maintainer:    Robin Becker <robin@jessikat.demon.co.uk>
  4. " Last change:    1997 July 11
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8. " A bunch of useful C keywords
  9. syn keyword tclStatement        proc global array set break return continue
  10. syn keyword tclLabel         case default
  11. syn keyword tclConditional    if else switch
  12. syn keyword tclRepeat        while for foreach
  13.  
  14. syn keyword tclTodo contained    TODO
  15.  
  16. " String and Character contstants
  17. " Highlight special characters (those which have a backslash) differently
  18. syn match   tclSpecial contained "\\[0-9][0-9][0-9]\|\\."
  19. syn region  tclString          start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=tclSpecial
  20.  
  21. "integer number, or floating point number without a dot and with "f".
  22. syn case ignore
  23. syn match  tclNumber        "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
  24. "floating point number, with dot, optional exponent
  25. syn match  tclNumber        "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
  26. "floating point number, starting with a dot, optional exponent
  27. syn match  tclNumber        "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
  28. "floating point number, without dot, with exponent
  29. syn match  tclNumber        "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
  30. "hex number
  31. syn match  tclNumber        "0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
  32. "syn match  tclIdentifier    "\<[a-z_][a-z0-9_]*\>"
  33. syn case match
  34.  
  35. syn region  tclComment        start="^[     ]*\#" end="$" contains=tclTodo
  36.  
  37. "syn sync ccomment tclComment
  38.  
  39. if !exists("did_tcl_syntax_inits")
  40.   let did_tcl_syntax_inits = 1
  41.   " The default methods for highlighting.  Can be overridden later
  42.   hi link tclLabel        Label
  43.   hi link tclConditional    Conditional
  44.   hi link tclRepeat        Repeat
  45.   hi link tclNumber        Number
  46.   hi link tclError        Error
  47.   hi link tclStatement    Statement
  48.   hi link tclString        String
  49.   hi link tclComment        Comment
  50.   hi link tclSpecial        Special
  51.   hi link tclTodo        Todo
  52.   "hi link tclIdentifier    Identifier
  53.   "hi link tclOpSpecial    OpSpecial
  54. endif
  55.  
  56. let b:current_syntax = "tcl"
  57.  
  58. " vim: ts=8
  59.